<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>             <meta http-equiv="expires" content="0"></meta>             <meta http-equiv="Cache-Control" content="no-cache"></meta>             <meta http-equiv="Cache-Control" content="no-cache"></meta>
        <title>.:DMES:. - Repuestos y Consumibles</title>
        <link rel="stylesheet" type="text/css" href="#{request.contextPath}/css/webStyle.css"/>
        <script type="text/javascript">
            function start() {
                PF('statusDialog').show();
            }

            function stop() {
                PF('statusDialog').hide();
            }
            window.setTimeout("replacementInit()",1000);
        </script>
    </h:head>
    <h:body style="background-color: #000;">
        <p:ajaxStatus onstart="PF('statusDialog').show()" oncomplete="PF('statusDialog').hide()"/>
        <p:dialog modal="true" widgetVar="statusDialog" header="Cargando..."
                  draggable="false" closable="false" resizable="false">
            <p:graphicImage value="/images/loadBar.gif"/>
        </p:dialog>
        <div>
            <p:growl autoUpdate="true" showDetail="true" life="8000" />
            <!--         Dialogo para guardar nuevos Repuestos y Consumibles         -->
            <p:dialog id="dialogReplacementSave" widgetVar="dialogReplacementSave" draggable="true" 
                      closable="true"  header="Crear Repuestos y Consumibles" position="center top" width="800"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="true">

                <h:form id="formWizardSave" >

                    <p:wizard  flowListener="#{scReplacementBean.onFlowProcessSaveReplacement}" id="wizardSave" widgetVar="wizardSave" 
                               backLabel="Atras" nextLabel="Siguiente">
                        <p:tab title="Datos Generales" id="tabGeneral" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los datos básicos del repuesto y consumible">
                            <p:panel header="Datos Básicos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Imagen"/>
                                        </td>
                                        <td width="40%" align="left" valign="middle">
                                            <h:graphicImage value="#{scReplacementBean.searchImage(scReplacementBean.replacementSave)}" alt="Imagen no disponible" id="imageSave" 
                                                            width="120" height="120"  />
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnPicture" icon="ui-icon-image"  oncomplete="PF('pictureSave').show()" style="top: -10px;"
                                                              ignoreAutoUpdate="true"/>                                       
                                        </td>
                                        <td colspan="2" ></td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameReplacement" value="Nombre Repuesto*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfNameReplacement"  value="#{scReplacementBean.replacementSave.name}"
                                                            />

                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfUsefulLife" value="Vida Útil"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfUsefulLife"  value="#{scReplacementBean.replacementSave.usefulLife}"
                                                            style="width: 100px;"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbTime"  value="#{scReplacementBean.replacementSave.time}" 
                                                             converter="timeConverter" converterMessage="Error en el tipo de dato del tiempo" style="width: 100px; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scReplacementBean.timeList}" var="time" itemLabel="#{time.acronym}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbTypeReplacement" value="Tipo*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbTypeReplacement"  value="#{scReplacementBean.replacementSave.typeReplacement}" 
                                                             style="width: 70%; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItem itemLabel="Repuesto" itemValue="Repuesto"/>
                                                <f:selectItem itemLabel="Consumible" itemValue="Consumible"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueReplacement" value="Valor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfValueReplacement"  value="#{scReplacementBean.replacementSave.value}" 
                                                            requiredMessage="Debe ingresar el valor del repuesto y consumible" style="width: 100px;"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbMoney"  value="#{scReplacementBean.replacementSave.money}" 
                                                             converter="moneyConverter" converterMessage="Error en el tipo de dato de la moneda" style="width: 100px; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scReplacementBean.moneyList}" var="money" itemLabel="#{money.acronym} #{money.description}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkReplacement" value="Marca*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfMarkReplacement"  value="#{scReplacementBean.replacementSave.mark}"
                                                            requiredMessage="Campo obligatorio debe ingresar la marca del repuesto y consumible"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieReplacement" value="Serie*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfSerieReplacement"  value="#{scReplacementBean.replacementSave.serie}"
                                                            />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbSupplier" value="Proveedor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbSupplier"  value="#{scReplacementBean.replacementSave.supplierGuarantee}" style="width: 70%;"
                                                             converter="partnerConverter" converterMessage="Error en el tipo de dato del proveedor y garantía"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scReplacementBean.partnersList}" var="partners" itemLabel="#{partners.companyName}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbCostCenter" value="Centro de Costos*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbCostCenter"  value="#{scReplacementBean.replacementSave.costCenter}" style="width: 70%;" 
                                                             converter="costCenterConverter" converterMessage="Error en el tipo de dato del centro de costos"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scReplacementBean.costCenterList}" var="costCenters" itemLabel="#{costCenters.description}"/>
                                            </p:selectOneMenu>
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnAddCostCenter" icon="ui-icon-circle-plus"  oncomplete="PF('centerCostSave').show()" style="top: -8px;"/>
                                            <p:tooltip for="btnAddCostCenter" value="Agregue nuevos centros de costos"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfStore" value="Almacén*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfStore"  value="#{scReplacementBean.replacementSave.stock.idStore}" style="width: 70%;"
                                                             converter="storeConverter" converterMessage="Error en el tipo de dato del almacén"
                                                             effect="puff"
                                                             height="140" >
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scReplacementBean.storesList}" var="stores" itemLabel="#{stores.name}"/>
                                                <p:ajax event="change" update="cbLocation,btnAddLocationReplacement" listener="#{scReplacementBean.withOutStore(scReplacementBean.replacementSave.stock.idStore)}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbLocation" value="Localización*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbLocation"  value="#{scReplacementBean.replacementSave.inputLocation}" style="width: 70%;" 
                                                             converter="inputLocationConverter" converterMessage="Error en el tipo de dato de la localización del repuesto y consumible"
                                                             effect="puff" disabled="#{scReplacementBean.withOutStore(scReplacementBean.replacementSave.stock.idStore)}"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scReplacementBean.replacementLocationsList}" var="replacementLocations" itemLabel="#{replacementLocations.location}"/>
                                            </p:selectOneMenu>
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnAddLocationReplacement" icon="ui-icon-circle-plus"  oncomplete="PF('replacementLocationSave').show()" style="top: -8px;"
                                                               disabled ="#{scReplacementBean.withOutStore(scReplacementBean.replacementSave.stock.idStore)}"/>
                                            <p:tooltip for="btnAddLocationReplacement" value="Agregue nuevas localizaciones"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfProirity" value="Prioridad*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfProirity"  value="#{scReplacementBean.replacementSave.priority}" style="width: 70%;"
                                                             converter="priorityConverter" converterMessage="Error en el tipo de dato de la prioridad"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scReplacementBean.priorityList}" var="priority" itemLabel="#{priority.name}"/>e
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfDescription" value="Descripción"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputTextarea  id="tfDescription"  value="#{scReplacementBean.replacementSave.description}"
                                                            />
                                        </td>
                                    </tr>
                                    
                                </table>
                            </p:panel>
                        </p:tab> 
                        <!--                        finaliza la pestaña para datos generales -->

                        <!--                        inicia la pestaña para el stock y -->
                        <p:tab title="Stock y Dimensiones" id="tabStock" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para el stock">
                            <p:panel header="Stock" toggleable="true" toggleTitle="Presione para minimizar el panel de Stock">
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfMaximeStock" value="Stock Máximo*"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfMaximeStock"  value="#{scReplacementBean.replacementSave.stock.maximeStock}"
                                                            />
                                        </td>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfMinimeStock" value="Stock Mínimo*"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfMinimeStock"  value="#{scReplacementBean.replacementSave.stock.minimeStock}"
                                                            />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfCurrentStock" value="Stock Real*"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfCurrentStock"  value="#{scReplacementBean.replacementSave.stock.currentStock}"
                                                            >
                                                <p:ajax event="keyup" update="tfValueTotal" listener="#{scReplacementBean.calcuteTotalPrice()}"/>
                                            </p:inputText>
                                        </td>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfOptimeStock" value="Stock Óptimo*"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfOptimeStock"  value="#{scReplacementBean.replacementSave.stock.optimeStock}"
                                                            />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfPriceUnit" value="Precio por Und"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfPriceUnit"  value="#{scReplacementBean.replacementSave.stock.priceUnit} #{scReplacementBean.replacementSave.money.acronym}" disabled="true"
                                                            />
                                        </td>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfValueTotal" value="Valor Total"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfValueTotal"  value="#{scReplacementBean.replacementSave.stock.totalValue}  #{scReplacementBean.replacementSave.money.acronym}" disabled="true"
                                                            />
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                            <p:panel header="Dimensiones" 
                                     id="pnlDimension">
                                <f:facet name="header">
                                    <p:outputLabel value="Dimensiones" style="text-align: center;"/>
                                </f:facet>
                                <f:facet name="header">
                                    <p:commandButton icon="ui-icon-plus" id="btnAddMeasure" style="float: right;"  
                                                     oncomplete="PF('measureSave').show()">
                                        <p:tooltip for="btnAddMeasure" value="Agregar una medida"/>
                                    </p:commandButton>
                                </f:facet>
                                <table width="98%" cellspacing="10"  >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfHigh" value="Altura*"/>

                                        </td>
                                        <td width="40%" align="left">

                                            <p:inputText    id="tfHigh"  value="#{scReplacementBean.replacementSave.dimension.hight}"
                                                            requiredMessage="Debe ingresar la altura" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureHigh" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureHigh"  value="#{scReplacementBean.measureUnitSaveHigh}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSave.dimension.hight, 1)}" >
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>


                                        </td> 
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWidth" value="Ancho*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWidth"  value="#{scReplacementBean.replacementSave.dimension.width}"
                                                            requiredMessage="Debe ingresar el ancho" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureWidth" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWidth"  value="#{scReplacementBean.measureUnitSaveWidth}" style="width: 60px; top: 6px;"
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSave.dimension.width, 2)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfLarge" value="Largo*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfLarge"  value="#{scReplacementBean.replacementSave.dimension.large}"
                                                            requiredMessage="Debe ingresar el alto" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureLarge" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureLarge"  value="#{scReplacementBean.measureUnitSaveLarge}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSave.dimension.large, 3)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfVolume" value="Volumen"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfVolume"  value="#{scReplacementBean.replacementSave.dimension.volume}"
                                                            requiredMessage="Debe ingresar el volumen" style="width: 100px; ">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureVolume" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureVolume"  value="#{scReplacementBean.measureUnitSaveVolume}" style="width: 60px; top: 6px; " 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSave.dimension.volume, 4)}"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfThickness" value="Grosor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfThickness"  value="#{scReplacementBean.replacementSave.dimension.thickness}"
                                                            requiredMessage="Debe ingresar el grosor" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureThickness" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureThickness"  value="#{scReplacementBean.measureUnitSaveThickness}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSave.dimension.thickness, 5)}"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfRadio" value="Radio"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfRadio"  value="#{scReplacementBean.replacementSave.dimension.radio}"
                                                            requiredMessage="Debe ingresar el radio" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureRadio" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureRadio"  value="#{scReplacementBean.measureUnitSaveRadio}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSave.dimension.radio, 6)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWeight" value="Peso*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWeight"  value="#{scReplacementBean.replacementSave.dimension.weight}"
                                                            requiredMessage="Debe ingresar el peso" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureWeight" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWeight"  value="#{scReplacementBean.measureUnitSaveWeight}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSave.dimension.weight, 7)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfObservationsDimension" value="Observaciones"/>
                                        </td>
                                        <td  width="40%" align="left"> 
                                            <p:inputTextarea   id="tfObservationsDimension"  value="#{scReplacementBean.replacementSave.dimension.observations}"
                                                               style="width: 98%;"     />
                                        </td>
                                    </tr>

                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para stock y dimensiones-->
                        <!--                        inicia pestaña para especificaciones-->
                        <p:tab title="Especificaciones" id="tabSpecifications" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las especificaciones del repuesto y consumible">
                            <p:panel header="Especificaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleSpecification" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleSpecification" value="#{scReplacementBean.replacementAttachedSave.tittle}"/>
                                                        <p:tooltip for="tfTittleSpecification" value="Ingrese el título de la especificacion a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfSpecificationSave" value="Especificación"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfSpecificationSave" value="#{scReplacementBean.replacementAttachedSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleSpecification,tfSpecificationSave,dataTableSpecificationSave"
                                                                             actionListener="#{scReplacementBean.saveAttached(scReplacementBean.replacementAttachedSave, scReplacementBean.replacementSave, scReplacementBean.attachedListSave, 'SPECIFICATION')}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableSpecificationSave"
                                                         var="specifications" 
                                                         value="#{scReplacementBean.getAttachedList(scReplacementBean.attachedListSave, 'SPECIFICATION')}"
                                                         rowKey="#{specifications.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{specifications.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableSpecificationSave" title="Eliminar Especificaciones"
                                                                     process="dataTableSpecificationSave" 
                                                                     actionListener="#{scReplacementBean.deleteAttached(scReplacementBean.attachedListSave, specifications)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{specifications.tittle}">
                                                    <p:outputLabel value="#{specifications.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{specifications.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{specifications.description}">
                                                    <p:outputLabel value="#{specifications.description}" id="outDescription"/>
                                                    <p:tooltip value="#{specifications.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para especificaciones-->
                        <!--                        inicia pestaña para características-->
                        <p:tab title="Características" id="tabFeactures" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las características del repuesto y consumible">
                            <p:panel header="Características" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleFeacture" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleFeacture" value="#{scReplacementBean.replacementAttachedSave.tittle}"/>
                                                        <p:tooltip for="tfTittleFeacture" value="Ingrese el título de la característica a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfFeactureSave" value="Característica"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfFeactureSave" value="#{scReplacementBean.replacementAttachedSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleFeacture,tfFeactureSave,dataTableFeactureSave"
                                                                             actionListener="#{scReplacementBean.saveAttached(scReplacementBean.replacementAttachedSave, scReplacementBean.replacementSave, scReplacementBean.attachedListSave, 'FEACTURE')}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableFeactureSave"
                                                         var="feactures" 
                                                         value="#{scReplacementBean.getAttachedList(scReplacementBean.attachedListSave, 'FEACTURE')}"
                                                         rowKey="#{feactures.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{feactures.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableFeactureSave" title="Eliminar Características"
                                                                     process="dataTableFeactureSave" 
                                                                     actionListener="#{scReplacementBean.deleteAttached(scReplacementBean.attachedListSave, feactures)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{feactures.tittle}">
                                                    <p:outputLabel value="#{feactures.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{feactures.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{feactures.description}">
                                                    <p:outputLabel value="#{feactures.description}" id="outDescription"/>
                                                    <p:tooltip value="#{feactures.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para características-->
                        <!--                        inicia pestaña para observaciones-->
                        <p:tab title="Observaciones" id="tabObservations" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las observaciones del repuesto y consumible">
                            <p:panel header="Observaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleObservation" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleObservation" value="#{scReplacementBean.replacementAttachedSave.tittle}"/>
                                                        <p:tooltip for="tfTittleObservation" value="Ingrese el título de la observación a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfObservationSave" value="Observación"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfObservationSave" value="#{scReplacementBean.replacementAttachedSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleObservation,tfObservationSave,dataTableObservationSave"
                                                                             actionListener="#{scReplacementBean.saveAttached(scReplacementBean.replacementAttachedSave, scReplacementBean.replacementSave, scReplacementBean.attachedListSave, 'OBSERVATION')}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableObservationSave"
                                                         var="observation" 
                                                         value="#{scReplacementBean.getAttachedList(scReplacementBean.attachedListSave, 'OBSERVATION')}"
                                                         rowKey="#{observation.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{observation.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableObservationSave" title="Eliminar Observaciones"
                                                                     process="dataTableObservationSave" 
                                                                     actionListener="#{scReplacementBean.deleteAttached(scReplacementBean.attachedListSave, observation)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{observation.tittle}">
                                                    <p:outputLabel value="#{observation.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{observation.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{observation.description}">
                                                    <p:outputLabel value="#{observation.description}" id="outDescription"/>
                                                    <p:tooltip value="#{observation.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para observaciones-->
                        <!--                        inicia pestaña para documentos-->
                        <p:tab title="Documentos" id="tabDocuments" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los documentos del repuesto y consumible">
                            <p:panel header="Documentos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableDocumentationSave"
                                                         var="document" 
                                                         value="#{scReplacementBean.documentsListSave}"
                                                         rowKey="#{document.documentTittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{document.documentTittle}">

                                                <f:facet name="header">
                                                    <p:commandButton icon="ui-icon-plus" id="btnAdd" style="float: right;"  
                                                                     oncomplete="PF('documentSave').show()">
                                                        <p:tooltip for="btnAdd" value="Agregar un Documento"/>
                                                    </p:commandButton>
                                                </f:facet>
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableDocumentationSave" title="Eliminar Documentos"
                                                                     process="@this" 
                                                                     actionListener="#{scReplacementBean.deleteDocument(document)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{document.documentTittle}">
                                                    <p:outputLabel value="#{document.documentTittle}" id="outTittle"/>
                                                    <p:tooltip value="#{document.documentTittle}" for="outTittle"/>
                                                </p:column>                                                 
                                                <p:column  headerText="Documento" sortBy="#{document.documentName}">
                                                    <p:outputLabel value="#{document.documentName}" id="documentName"/>
                                                    <p:tooltip value="#{document.documentName}" for="documentName"/>
                                                </p:column>
                                                <p:column  headerText="Fecha de Subida" sortBy="#{scReplacementBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}">
                                                    <p:outputLabel value="#{scReplacementBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" id="uploadDate"/>
                                                    <p:tooltip value="#{scReplacementBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" for="uploadDate"/>
                                                </p:column>
                                                <p:column  headerText="Subido por" sortBy="#{document.uploadBy}">
                                                    <p:outputLabel value="#{document.uploadBy}" id="uploadBy"/>
                                                    <p:tooltip value="#{document.uploadBy}" for="uploadBy"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para documentos                         -->
                        <!--        inicia la pestaña para confirmar datos de guardar-->
                        <p:tab title="Confirmar datos" id="tabConfirmSave" titleStyleClass="tabTittleSavePerson"
                               titletip="Pestaña para confirmar los datos del repuesto y consumible a crear">
                            <p:panel header="Crear Repuesto y Consumible" style="text-align: center;">
                                <table width="98%" cellspacing="10" style="text-align: center;">
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameReplacementSave" value="Nombre Repuesto"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfNameReplacementSave"  value="#{scReplacementBean.replacementSave.name}"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfExpiryDateSave" value="Vida Útil"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfExpiryDateSave"  value="#{scReplacementBean.replacementSave.usefulLife} #{scReplacementBean.replacementSave.time.acronym}"
                                                              />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfTypeMaterialSave" value="Tipo"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfTypeMaterialSave"  value="#{scReplacementBean.replacementSave.typeReplacement}"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueReplacementSave" value="Valor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfValueReplacementSave"  value="#{scReplacementBean.replacementSave.value} #{scReplacementBean.replacementSave.money.acronym}"/>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkReplacementSave" value="Marca"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfMarkReplacementSave"  value="#{scReplacementBean.replacementSave.mark}"
                                                              />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieReplacementSave" value="Serie"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfSerieReplacementSave"  value="#{scReplacementBean.replacementSave.serie}"
                                                              />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="98%" colspan="2">
                                            <p:commandButton id="btnSaveReplacement" value="Guardar Repuesto" onsuccess="PF('dialogReplacementSave').hide()"
                                                             actionListener="#{scReplacementBean.saveReplacement()}" update=":formReplacement:scDataTableReplacements,:formWizardSave"
                                                             oncomplete="PF('wizardSave').loadStep('tabGeneral', false)"/>
                                            <p:spacer width="30"/>
                                            <p:commandButton id="btnCancelPartner" value="Cancelar" oncomplete="PF('dialogReplacementSave').hide();PF('wizardSave').loadStep('tabGeneral', false)"
                                                             actionListener="#{scReplacementBean.cleanReplacementSave()}" update=":formReplacement:scDataTableReplacements,:formWizardSave"/>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>

                        </p:tab>
                        <!--        finaliza la pestaña para confirmar datos de guardar-->
                    </p:wizard>
                </h:form>
                <p:ajax event="close" oncomplete="PF('wizardSave').loadStep('tabGeneral', true)" listener="#{scReplacementBean.cleanReplacementSave()}" update=":formReplacement:scDataTableReplacements,:formWizardSave"/>
            </p:dialog>
            <!--         finaliza el dialogo para guardar Repuestos y Consumibles               -->






            <!--###########inicia el dialogo para actualizar repuesto y consumibles#############-->
            <p:dialog id="dialogReplacementUpdate" widgetVar="dialogReplacementUpdate" draggable="true" 
                      closable="true"  header="Actualizar Repuestos y Consumibles" position="center top" width="800"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="true">

                <h:form id="formWizardUpdate" >

                    <p:wizard  flowListener="#{scReplacementBean.onFlowProcessUpdateReplacement}" id="wizardUpdate" widgetVar="wizardUpdate" 
                               backLabel="Atras" nextLabel="Siguiente">
                        <p:tab title="Datos Generales" id="tabGeneral" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los datos básicos del repuesto y consumible">
                            <p:panel header="Datos Básicos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Imagen"/>
                                        </td>
                                        <td width="40%" align="left" valign="middle">
                                            <h:graphicImage value="#{scReplacementBean.searchImage(scReplacementBean.replacementSelected)}" alt="Imagen no disponible" id="imageSave" 
                                                            width="120" height="120"  />
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnPicture" icon="ui-icon-image"  oncomplete="PF('pictureUpdate').show()" style="top: -10px;"
                                                              ignoreAutoUpdate="true"/>                                       
                                        </td>
                                        <td colspan="2" ></td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameReplacement" value="Nombre Repuesto*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfNameReplacement"  value="#{scReplacementBean.replacementSelected.name}"
                                                            />

                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfUsefulLife" value="Vida Útil"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfUsefulLife"  value="#{scReplacementBean.replacementSelected.usefulLife}"
                                                            style="width: 100px;"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbTime"  value="#{scReplacementBean.replacementSelected.time}" 
                                                             converter="timeConverter" converterMessage="Error en el tipo de dato del tiempo" style="width: 100px; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scReplacementBean.timeList}" var="time" itemLabel="#{time.acronym}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbTypeReplacement" value="Tipo*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbTypeReplacement"  value="#{scReplacementBean.replacementSelected.typeReplacement}" 
                                                             style="width: 70%; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItem itemLabel="Repuesto" itemValue="Repuesto"/>
                                                <f:selectItem itemLabel="Consumible" itemValue="Consumible"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueReplacement" value="Valor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfValueReplacement"  value="#{scReplacementBean.replacementSelected.value}" 
                                                            requiredMessage="Debe ingresar el valor del repuesto y consumible" style="width: 100px;"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbMoney"  value="#{scReplacementBean.replacementSelected.money}" 
                                                             converter="moneyConverter" converterMessage="Error en el tipo de dato de la moneda" style="width: 100px; top: 6px;"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scReplacementBean.moneyList}" var="money" itemLabel="#{money.acronym} #{money.description}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkReplacement" value="Marca*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfMarkReplacement"  value="#{scReplacementBean.replacementSelected.mark}"
                                                            requiredMessage="Campo obligatorio debe ingresar la marca del repuesto y consumible"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieReplacement" value="Serie*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfSerieReplacement"  value="#{scReplacementBean.replacementSelected.serie}"
                                                            />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbSupplier" value="Proveedor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbSupplier"  value="#{scReplacementBean.replacementSelected.supplierGuarantee}" style="width: 70%;"
                                                             converter="partnerConverter" converterMessage="Error en el tipo de dato del proveedor y garantía"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scReplacementBean.partnersList}" var="partners" itemLabel="#{partners.companyName}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbCostCenter" value="Centro de Costos*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbCostCenter"  value="#{scReplacementBean.replacementSelected.costCenter}" style="width: 70%;" 
                                                             converter="costCenterConverter" converterMessage="Error en el tipo de dato del centro de costos"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scReplacementBean.costCenterList}" var="costCenters" itemLabel="#{costCenters.description}"/>
                                            </p:selectOneMenu>
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnAddCostCenter" icon="ui-icon-circle-plus"  oncomplete="PF('centerCostSave').show()" style="top: -8px;"/>
                                            <p:tooltip for="btnAddCostCenter" value="Agregue nuevos centros de costos"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfStore" value="Almacén*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfStore"  value="#{scReplacementBean.replacementSelected.stock.idStore}" style="width: 70%;"
                                                             converter="storeConverter" converterMessage="Error en el tipo de dato del almacén"
                                                             effect="puff"
                                                             height="140" >
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scReplacementBean.storesList}" var="stores" itemLabel="#{stores.name}"/>
                                                <p:ajax event="change" update="cbLocation,btnAddLocationReplacement" listener="#{scReplacementBean.withOutStore(scReplacementBean.replacementSelected.stock.idStore)}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbLocation" value="Localización*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbLocation"  value="#{scReplacementBean.replacementSelected.inputLocation}" style="width: 70%;" 
                                                             converter="inputLocationConverter" converterMessage="Error en el tipo de dato de la localización del repuesto y consumible"
                                                             effect="puff" disabled="#{scReplacementBean.withOutStore(scReplacementBean.replacementSelected.stock.idStore)}"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scReplacementBean.replacementLocationsList}" var="replacementLocations" itemLabel="#{replacementLocations.location}"/>
                                            </p:selectOneMenu>
                                            <p:spacer width="5px"/>
                                            <p:commandButton  id="btnAddLocationReplacement" icon="ui-icon-circle-plus"  oncomplete="PF('replacementLocationSave').show()" style="top: -8px;"
                                                               disabled ="#{scReplacementBean.withOutStore(scReplacementBean.replacementSelected.stock.idStore)}"/>
                                            <p:tooltip for="btnAddLocationReplacement" value="Agregue nuevas localizaciones"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfProirity" value="Prioridad*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfProirity"  value="#{scReplacementBean.replacementSelected.priority}" style="width: 70%;"
                                                             converter="priorityConverter" converterMessage="Error en el tipo de dato de la prioridad"
                                                             effect="puff"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scReplacementBean.priorityList}" var="priority" itemLabel="#{priority.name}"/>e
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfDescription" value="Descripción"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputTextarea  id="tfDescription"  value="#{scReplacementBean.replacementSelected.description}"
                                                            />
                                        </td>
                                    </tr>
                                    
                                </table>
                            </p:panel>
                        </p:tab> 
                        <!--                        finaliza la pestaña para datos generales -->

                        <!--                        inicia la pestaña para el stock y -->
                        <p:tab title="Stock y Dimensiones" id="tabStock" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para el stock">
                            <p:panel header="Stock" toggleable="true" toggleTitle="Presione para minimizar el panel de Stock">
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfMaximeStock" value="Stock Máximo*"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfMaximeStock"  value="#{scReplacementBean.replacementSelected.stock.maximeStock}"
                                                            />
                                        </td>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfMinimeStock" value="Stock Mínimo*"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfMinimeStock"  value="#{scReplacementBean.replacementSelected.stock.minimeStock}"
                                                            />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfCurrentStock" value="Stock Real*"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfCurrentStock"  value="#{scReplacementBean.replacementSelected.stock.currentStock}"
                                                            >
                                                <p:ajax event="keyup" update="tfValueTotal" listener="#{scReplacementBean.calcuteTotalPrice()}"/>
                                            </p:inputText>
                                        </td>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfOptimeStock" value="Stock Óptimo*"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfOptimeStock"  value="#{scReplacementBean.replacementSelected.stock.optimeStock}"
                                                            />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfPriceUnit" value="Precio por Und"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfPriceUnit"  value="#{scReplacementBean.replacementSelected.stock.priceUnit} #{scReplacementBean.replacementSelected.money.acronym}" disabled="true"
                                                            />
                                        </td>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfValueTotal" value="Valor Total"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfValueTotal"  value="#{scReplacementBean.replacementSelected.stock.totalValue}  #{scReplacementBean.replacementSelected.money.acronym}" disabled="true"
                                                            />
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                            <p:panel header="Dimensiones" 
                                     id="pnlDimension">
                                <f:facet name="header">
                                    <p:outputLabel value="Dimensiones" style="text-align: center;"/>
                                </f:facet>
                                <f:facet name="header">
                                    <p:commandButton icon="ui-icon-plus" id="btnAddMeasure" style="float: right;"  
                                                     oncomplete="PF('measureSave').show()">
                                        <p:tooltip for="btnAddMeasure" value="Agregar una medida"/>
                                    </p:commandButton>
                                </f:facet>
                                <table width="98%" cellspacing="10"  >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfHigh" value="Altura*"/>

                                        </td>
                                        <td width="40%" align="left">

                                            <p:inputText    id="tfHigh"  value="#{scReplacementBean.replacementSelected.dimension.hight}"
                                                            requiredMessage="Debe ingresar la altura" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureHigh" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureHigh"  value="#{scReplacementBean.measureUnitSaveHigh}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSelected.dimension.hight, 1)}" >
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>


                                        </td> 
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWidth" value="Ancho*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWidth"  value="#{scReplacementBean.replacementSelected.dimension.width}"
                                                            requiredMessage="Debe ingresar el ancho" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureWidth" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWidth"  value="#{scReplacementBean.measureUnitSaveWidth}" style="width: 60px; top: 6px;"
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSelected.dimension.width, 2)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfLarge" value="Largo*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfLarge"  value="#{scReplacementBean.replacementSelected.dimension.large}"
                                                            requiredMessage="Debe ingresar el alto" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureLarge" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureLarge"  value="#{scReplacementBean.measureUnitSaveLarge}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSelected.dimension.large, 3)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfVolume" value="Volumen"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfVolume"  value="#{scReplacementBean.replacementSelected.dimension.volume}"
                                                            requiredMessage="Debe ingresar el volumen" style="width: 100px; ">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureVolume" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureVolume"  value="#{scReplacementBean.measureUnitSaveVolume}" style="width: 60px; top: 6px; " 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSelected.dimension.volume, 4)}"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfThickness" value="Grosor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfThickness"  value="#{scReplacementBean.replacementSelected.dimension.thickness}"
                                                            requiredMessage="Debe ingresar el grosor" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureThickness" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureThickness"  value="#{scReplacementBean.measureUnitSaveThickness}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSelected.dimension.thickness, 5)}"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfRadio" value="Radio"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfRadio"  value="#{scReplacementBean.replacementSelected.dimension.radio}"
                                                            requiredMessage="Debe ingresar el radio" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureRadio" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureRadio"  value="#{scReplacementBean.measureUnitSaveRadio}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSelected.dimension.radio, 6)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWeight" value="Peso*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWeight"  value="#{scReplacementBean.replacementSelected.dimension.weight}"
                                                            requiredMessage="Debe ingresar el peso" style="width: 100px;">
                                                <p:ajax event="keyup" update=":formWizardSave:cbMeasureWeight" />
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWeight"  value="#{scReplacementBean.measureUnitSaveWeight}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="#{!scReplacementBean.showItem(scReplacementBean.replacementSelected.dimension.weight, 7)}">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfObservationsDimension" value="Observaciones"/>
                                        </td>
                                        <td  width="40%" align="left"> 
                                            <p:inputTextarea   id="tfObservationsDimension"  value="#{scReplacementBean.replacementSelected.dimension.observations}"
                                                               style="width: 98%;"     />
                                        </td>
                                    </tr>

                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para stock y dimensiones-->
                        <!--                        inicia pestaña para especificaciones-->
                        <p:tab title="Especificaciones" id="tabSpecifications" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las especificaciones del repuesto y consumible">
                            <p:panel header="Especificaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleSpecification" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleSpecification" value="#{scReplacementBean.replacementAttachedSave.tittle}"/>
                                                        <p:tooltip for="tfTittleSpecification" value="Ingrese el título de la especificacion a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfSpecificationSave" value="Especificación"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfSpecificationSave" value="#{scReplacementBean.replacementAttachedSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleSpecification,tfSpecificationSave,dataTableSpecificationSave"
                                                                             actionListener="#{scReplacementBean.saveAttached(scReplacementBean.replacementAttachedSave, scReplacementBean.replacementSelected, scReplacementBean.replacementSelected.replacementAttacheds, 'SPECIFICATION')}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableSpecificationSave"
                                                         var="specifications" 
                                                         value="#{scReplacementBean.getAttachedList(scReplacementBean.replacementSelected.replacementAttacheds, 'SPECIFICATION')}"
                                                         rowKey="#{specifications.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{specifications.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableSpecificationSave" title="Eliminar Especificaciones"
                                                                     process="dataTableSpecificationSave" 
                                                                     actionListener="#{scReplacementBean.deleteAttached(scReplacementBean.replacementSelected.replacementAttacheds, specifications)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{specifications.tittle}">
                                                    <p:outputLabel value="#{specifications.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{specifications.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{specifications.description}">
                                                    <p:outputLabel value="#{specifications.description}" id="outDescription"/>
                                                    <p:tooltip value="#{specifications.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para especificaciones-->
                        <!--                        inicia pestaña para características-->
                        <p:tab title="Características" id="tabFeactures" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las características del repuesto y consumible">
                            <p:panel header="Características" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleFeacture" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleFeacture" value="#{scReplacementBean.replacementAttachedSave.tittle}"/>
                                                        <p:tooltip for="tfTittleFeacture" value="Ingrese el título de la característica a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfFeactureSave" value="Característica"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfFeactureSave" value="#{scReplacementBean.replacementAttachedSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleFeacture,tfFeactureSave,dataTableFeactureSave"
                                                                             actionListener="#{scReplacementBean.saveAttached(scReplacementBean.replacementAttachedSave, scReplacementBean.replacementSelected, scReplacementBean.replacementSelected.replacementAttacheds, 'FEACTURE')}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableFeactureSave"
                                                         var="feactures" 
                                                         value="#{scReplacementBean.getAttachedList(scReplacementBean.replacementSelected.replacementAttacheds, 'FEACTURE')}"
                                                         rowKey="#{feactures.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{feactures.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableFeactureSave" title="Eliminar Características"
                                                                     process="dataTableFeactureSave" 
                                                                     actionListener="#{scReplacementBean.deleteAttached(scReplacementBean.replacementSelected.replacementAttacheds, feactures)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{feactures.tittle}">
                                                    <p:outputLabel value="#{feactures.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{feactures.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{feactures.description}">
                                                    <p:outputLabel value="#{feactures.description}" id="outDescription"/>
                                                    <p:tooltip value="#{feactures.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para características-->
                        <!--                        inicia pestaña para observaciones-->
                        <p:tab title="Observaciones" id="tabObservations" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las observaciones del repuesto y consumible">
                            <p:panel header="Observaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="40%">
                                            <table width="100%" cellspacing="10">
                                                <tr>
                                                    <td width="40%" >
                                                        <p:outputLabel for="tfTittleObservation" value="Título"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputText id="tfTittleObservation" value="#{scReplacementBean.replacementAttachedSave.tittle}"/>
                                                        <p:tooltip for="tfTittleObservation" value="Ingrese el título de la observación a Realizar"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="40%">
                                                        <p:outputLabel for="tfObservationSave" value="Observación"/>
                                                    </td>
                                                    <td width="60%">
                                                        <p:inputTextarea id="tfObservationSave" value="#{scReplacementBean.replacementAttachedSave.description}"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2">
                                                        <center>
                                                            <p:commandButton value="Guardar" update="tfTittleObservation,tfObservationSave,dataTableObservationSave"
                                                                             actionListener="#{scReplacementBean.saveAttached(scReplacementBean.replacementAttachedSave, scReplacementBean.replacementSelected, scReplacementBean.replacementSelected.replacementAttacheds, 'OBSERVATION')}"/>
                                                        </center>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableObservationSave"
                                                         var="observation" 
                                                         value="#{scReplacementBean.getAttachedList(scReplacementBean.replacementSelected.replacementAttacheds, 'OBSERVATION')}"
                                                         rowKey="#{observation.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{observation.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableObservationSave" title="Eliminar Observaciones"
                                                                     process="dataTableObservationSave" 
                                                                     actionListener="#{scReplacementBean.deleteAttached(scReplacementBean.replacementSelected.replacementAttacheds, observation)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{observation.tittle}">
                                                    <p:outputLabel value="#{observation.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{observation.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{observation.description}">
                                                    <p:outputLabel value="#{observation.description}" id="outDescription"/>
                                                    <p:tooltip value="#{observation.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para observaciones-->

                        <!--                        inicia pestaña para documentos-->
                        <p:tab title="Documentos" id="tabDocuments" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los documentos del repuesto y consumible">
                            <p:panel header="Documentos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableDocumentationSave"
                                                         var="document" 
                                                         value="#{scReplacementBean.replacementSelected.replacementDocuments}"
                                                         rowKey="#{document.documentTittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{document.documentTittle}">

                                                <f:facet name="header">
                                                    <p:commandButton icon="ui-icon-plus" id="btnAdd" style="float: right;"  
                                                                     oncomplete="PF('documentUpdate').show()">
                                                        <p:tooltip for="btnAdd" value="Agregar un Documento"/>
                                                    </p:commandButton>
                                                </f:facet>
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableDocumentationSave" title="Eliminar Documentos"
                                                                     process="@this" 
                                                                     actionListener="#{scReplacementBean.deleteDocumentUpdate(document)}" > 
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{document.documentTittle}">
                                                    <p:outputLabel value="#{document.documentTittle}" id="outTittle"/>
                                                    <p:tooltip value="#{document.documentTittle}" for="outTittle"/>
                                                </p:column>                                                 
                                                <p:column  headerText="Documento" sortBy="#{document.documentName}">
                                                    <p:outputLabel value="#{document.documentName}" id="documentName"/>
                                                    <p:tooltip value="#{document.documentName}" for="documentName"/>
                                                </p:column>
                                                <p:column  headerText="Fecha de Subida" sortBy="#{scReplacementBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}">
                                                    <p:outputLabel value="#{scReplacementBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" id="uploadDate"/>
                                                    <p:tooltip value="#{scReplacementBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" for="uploadDate"/>
                                                </p:column>
                                                <p:column  headerText="Subido por" sortBy="#{document.uploadBy}">
                                                    <p:outputLabel value="#{document.uploadBy}" id="uploadBy"/>
                                                    <p:tooltip value="#{document.uploadBy}" for="uploadBy"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para documentos
                        -->

                        <!--        inicia la pestaña para confirmar datos de guardar-->
                        <p:tab title="Confirmar datos" id="tabConfirmSave" titleStyleClass="tabTittleSavePerson"
                               titletip="Pestaña para confirmar los datos del repuesto y consumible a crear">
                            <p:panel header="Actualizar Repuesto" style="text-align: center;">
                                <table width="98%" cellspacing="10" style="text-align: center;">
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameReplacementSave" value="Nombre Repuesto"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfNameReplacementSave"  value="#{scReplacementBean.replacementSelected.name}"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfExpiryDateSave" value="Vida Útil (años)"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfExpiryDateSave"  value="#{scReplacementBean.replacementSelected.usefulLife} #{scReplacementBean.replacementSelected.time.acronym}"
                                                              />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfTypeMaterialSave" value="Tipo"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfTypeMaterialSave"  value="#{scReplacementBean.replacementSelected.typeReplacement}"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueReplacementSave" value="Valor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfValueReplacementSave"  value="#{scReplacementBean.replacementSelected.value} #{scReplacementBean.replacementSelected.money.acronym}"/>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkReplacementSave" value="Marca"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfMarkReplacementSave"  value="#{scReplacementBean.replacementSelected.mark}"
                                                              />
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieReplacementSave" value="Serie"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:outputLabel    id="tfSerieReplacementSave"  value="#{scReplacementBean.replacementSelected.serie}"
                                                              />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="98%" colspan="2">
                                            <p:commandButton id="btnSaveReplacement" value="Guardar Repuesto" onsuccess="PF('dialogReplacementUpdate').hide()"
                                                             actionListener="#{scReplacementBean.updateReplacement()}" update=":formReplacement:scDataTableReplacements,:formWizardUpdate"
                                                             oncomplete="PF('wizardUpdate').loadStep('tabGeneral', false)"/>
                                            <p:spacer width="30"/>
                                            <p:commandButton id="btnCancelPartner" value="Cancelar" oncomplete="PF('dialogReplacementUpdate').hide();PF('wizardUpdate').loadStep('tabGeneral', false)"
                                                             actionListener="#{scReplacementBean.joinColumnsUpdate()}" update=":formReplacement:scDataTableReplacements,:formWizardUpdate"/>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>

                        </p:tab>
                        <!--        finaliza la pestaña para confirmar datos de actualzar-->
                    </p:wizard>
                </h:form>
                <p:ajax event="close" oncomplete="PF('wizardUpdate').loadStep('tabGeneral', true)" 
                        update=":formReplacement:scDataTableReplacements,:formWizardUpdate" listener="#{scReplacementBean.joinColumnsUpdate()}"/>
            </p:dialog>
            <!--################ finaliza el dialogo para actualizar Repuestos y Consumibles #########################-->


            <!--             inicia el dialogo para eliminar registros           -->
            <p:dialog id="dialogReplacementDelete" widgetVar="dialogReplacementDelete" position="center top" 
                      closable="true" draggable="true" dynamic="true" header="Eliminar Repuestos y Consumibles"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="false">
                <h:form id="formWizardDelete">
                    <table width="100%" cellspacing="30" style="padding: 0px; margin: 0px;">
                        <tr>
                            <td>
                                <p:outputLabel value="¿Desea eliminar el repuesto y consumible
                                               #{scReplacementBean.replacementSelected.name}?" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <p:commandButton value="Eliminar" actionListener="#{scReplacementBean.deleteReplacement()}"  
                                                 onsuccess="PF('dialogReplacementDelete').hide()"
                                                 update="@this,:formReplacement:scDataTableReplacements"/>
                                <p:spacer width="20"/>

                                <p:commandButton value="Cancelar" oncomplete="PF('dialogReplacementDelete').hide()"
                                                 update="@this,:formReplacement:scDataTableReplacements" actionListener="#{scReplacementBean.cleanReplacementSave()}" />
                            </td>
                        </tr>
                    </table>
                </h:form>

            </p:dialog>
            <!--            finaliza el dialogo para eliminar registros            -->

            <!--###########inicia el dialogo para visualizar repuesto y consumibles#############-->
            <p:dialog id="dialogReplacementView" widgetVar="dialogReplacementView" draggable="true" 
                      closable="true"  header="Visualizar Repuestos y Consumibles" position="center top" width="800"
                      hideEffect="explode" modal="false" showEffect="explode" >

                <h:form id="formWizardView" >

                    <p:tabView activeIndex="0" dynamic="true" >
                        <p:tab title="Datos Generales" id="tabGeneral" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los datos básicos del repuesto y consumible">
                            <p:panel header="Datos Básicos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  value="Imagen"/>
                                        </td>
                                        <td width="40%" align="left" valign="middle">
                                            <h:graphicImage value="#{scReplacementBean.searchImage(scReplacementBean.replacementSelected)}" alt="Imagen no disponible" id="imageSave" 
                                                            width="120" height="120"  />
                                        </td>
                                        <td colspan="2" ></td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfNameReplacement" value="Nombre Repuesto*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfNameReplacement"  value="#{scReplacementBean.replacementSelected.name}"
                                                            disabled="true"/>

                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfUsefulLife" value="Vida Útil"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfUsefulLife"  value="#{scReplacementBean.replacementSelected.usefulLife}"
                                                            style="width: 100px;" disabled="true"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbTime"  value="#{scReplacementBean.replacementSelected.time}" 
                                                             converter="timeConverter" converterMessage="Error en el tipo de dato del tiempo" style="width: 100px; top: 6px;"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scReplacementBean.timeList}" var="time" itemLabel="#{time.acronym}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbTypeReplacement" value="Tipo*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbTypeReplacement"  value="#{scReplacementBean.replacementSelected.typeReplacement}" 
                                                             style="width: 70%; top: 6px;"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItem itemLabel="Repuesto" itemValue="Repuesto"/>
                                                <f:selectItem itemLabel="Consumible" itemValue="Consumible"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfValueReplacement" value="Valor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfValueReplacement"  value="#{scReplacementBean.replacementSelected.value}" disabled="true"
                                                            requiredMessage="Debe ingresar el valor del repuesto y consumible" style="width: 100px;"/>
                                            <p:spacer width="5"/>
                                            <p:selectOneMenu id="cbMoney"  value="#{scReplacementBean.replacementSelected.money}" 
                                                             converter="moneyConverter" converterMessage="Error en el tipo de dato de la moneda" style="width: 100px; top: 6px;"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..."/>
                                                <f:selectItems value="#{scReplacementBean.moneyList}" var="money" itemLabel="#{money.acronym} #{money.description}"/>

                                            </p:selectOneMenu>
                                        </td>
                                    </tr> 
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfMarkReplacement" value="Marca*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfMarkReplacement"  value="#{scReplacementBean.replacementSelected.mark}" disabled="true"
                                                            requiredMessage="Campo obligatorio debe ingresar la marca del repuesto y consumible"/>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfSerieReplacement" value="Serie*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfSerieReplacement"  value="#{scReplacementBean.replacementSelected.serie}"
                                                            disabled="true" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbSupplier" value="Proveedor*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbSupplier"  value="#{scReplacementBean.replacementSelected.supplierGuarantee}" style="width: 70%;"
                                                             converter="partnerConverter" converterMessage="Error en el tipo de dato del proveedor y garantía"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scReplacementBean.partnersList}" var="partners" itemLabel="#{partners.companyName}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbCostCenter" value="Centro de Costos*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbCostCenter"  value="#{scReplacementBean.replacementSelected.costCenter}" style="width: 70%;" 
                                                             converter="costCenterConverter" converterMessage="Error en el tipo de dato del centro de costos"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scReplacementBean.costCenterList}" var="costCenters" itemLabel="#{costCenters.description}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfStore" value="Almacén*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfStore"  value="#{scReplacementBean.replacementSelected.stock.idStore}" style="width: 70%;"
                                                             converter="storeConverter" converterMessage="Error en el tipo de dato del almacén"
                                                             effect="puff" disabled="true"
                                                             height="140" >
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scReplacementBean.storesList}" var="stores" itemLabel="#{stores.name}"/>
                                                
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="cbLocation" value="Localización*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="cbLocation"  value="#{scReplacementBean.replacementSelected.inputLocation}" style="width: 70%;" 
                                                             converter="inputLocationConverter" converterMessage="Error en el tipo de dato de la localización del repuesto y consumible"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems  value="#{scReplacementBean.replacementLocationsList}" var="replacementLocations" itemLabel="#{replacementLocations.location}"/>
                                            </p:selectOneMenu>
                                            
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfProirity" value="Prioridad*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:selectOneMenu id="tfProirity"  value="#{scReplacementBean.replacementSelected.priority}" style="width: 70%;"
                                                             converter="priorityConverter" converterMessage="Error en el tipo de dato de la prioridad"
                                                             effect="puff" disabled="true"
                                                             height="140">
                                                <f:selectItem itemLabel="..." />
                                                <f:selectItems value="#{scReplacementBean.priorityList}" var="priority" itemLabel="#{priority.name}"/>e
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfDescription" value="Descripción"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputTextarea  id="tfDescription"  value="#{scReplacementBean.replacementSelected.description}"
                                                            disabled="true" />
                                        </td>
                                    </tr>
                                    
                                </table>
                            </p:panel>
                        </p:tab> 
                        <!--                        finaliza la pestaña para datos generales -->

                        <!--                        inicia la pestaña para el stock y -->
                        <p:tab title="Stock y Dimensiones" id="tabStock" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para el stock">
                            <p:panel header="Stock" toggleable="true" toggleTitle="Presione para minimizar el panel de Stock">
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfMaximeStock" value="Stock Máximo*"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfMaximeStock"  value="#{scReplacementBean.replacementSelected.stock.maximeStock}"
                                                            disabled="true"/>
                                        </td>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfMinimeStock" value="Stock Mínimo*"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfMinimeStock"  value="#{scReplacementBean.replacementSelected.stock.minimeStock}"
                                                             disabled="true" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfCurrentStock" value="Stock Real*"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfCurrentStock"  value="#{scReplacementBean.replacementSelected.stock.currentStock}"
                                                            disabled="true" >
                                                
                                            </p:inputText>
                                        </td>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfOptimeStock" value="Stock Óptimo*"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfOptimeStock"  value="#{scReplacementBean.replacementSelected.stock.optimeStock}"
                                                             disabled="true"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfPriceUnit" value="Precio por Und"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfPriceUnit"  value="#{scReplacementBean.replacementSelected.stock.priceUnit} #{scReplacementBean.replacementSelected.money.acronym}" 
                                                            disabled="true"/>
                                        </td>
                                        <td width="20%" align="right">
                                            <p:outputLabel  for="tfValueTotal" value="Valor Total"/>
                                        </td>
                                        <td width="30%" align="left">
                                            <p:inputText    id="tfValueTotal"  value="#{scReplacementBean.replacementSelected.stock.totalValue}  #{scReplacementBean.replacementSelected.money.acronym}"
                                                            disabled="true"/>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                            <p:panel header="Dimensiones" 
                                     id="pnlDimension">
                                <f:facet name="header">
                                    <p:outputLabel value="Dimensiones" style="text-align: center;"/>
                                </f:facet>
                                <table width="98%" cellspacing="10"  >
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfHigh" value="Altura*"/>

                                        </td>
                                        <td width="40%" align="left">

                                            <p:inputText    id="tfHigh"  value="#{scReplacementBean.replacementSelected.dimension.hight}"
                                                            requiredMessage="Debe ingresar la altura" style="width: 100px;" disabled="true">
                                                
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureHigh"  value="#{scReplacementBean.measureUnitSaveHigh}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="true" >
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>


                                        </td> 
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWidth" value="Ancho*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWidth"  value="#{scReplacementBean.replacementSelected.dimension.width}"
                                                            requiredMessage="Debe ingresar el ancho" style="width: 100px;" disabled="true">
                                                
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWidth"  value="#{scReplacementBean.measureUnitSaveWidth}" style="width: 60px; top: 6px;"
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff" 
                                                             height="140" disabled="true">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfLarge" value="Largo*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfLarge"  value="#{scReplacementBean.replacementSelected.dimension.large}"
                                                            requiredMessage="Debe ingresar el alto" style="width: 100px;" disabled="true">
                                                
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureLarge"  value="#{scReplacementBean.measureUnitSaveLarge}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="true">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfVolume" value="Volumen"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfVolume"  value="#{scReplacementBean.replacementSelected.dimension.volume}"
                                                            requiredMessage="Debe ingresar el volumen" style="width: 100px; " disabled="true">
                                                
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureVolume"  value="#{scReplacementBean.measureUnitSaveVolume}" style="width: 60px; top: 6px; " 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="true"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfThickness" value="Grosor"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfThickness"  value="#{scReplacementBean.replacementSelected.dimension.thickness}"
                                                            requiredMessage="Debe ingresar el grosor" style="width: 100px;" disabled="true">
                                                
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureThickness"  value="#{scReplacementBean.measureUnitSaveThickness}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff" 
                                                             height="140" disabled="true"> 
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfRadio" value="Radio"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfRadio"  value="#{scReplacementBean.replacementSelected.dimension.radio}"
                                                            requiredMessage="Debe ingresar el radio" style="width: 100px;" disabled="true">
                                                
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureRadio"  value="#{scReplacementBean.measureUnitSaveRadio}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="true">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfWeight" value="Peso*"/>
                                        </td>
                                        <td width="40%" align="left">
                                            <p:inputText    id="tfWeight"  value="#{scReplacementBean.replacementSelected.dimension.weight}"
                                                            requiredMessage="Debe ingresar el peso" style="width: 100px;" disabled="true">
                                                
                                            </p:inputText>
                                            <p:spacer width="5px"/>
                                            <p:selectOneMenu id="cbMeasureWeight"  value="#{scReplacementBean.measureUnitSaveWeight}" style="width: 60px; top: 6px;" 
                                                             converter="measureConverter" converterMessage="Error en el tipo de dato de la medida"
                                                             required="true" requiredMessage="Campo obligatorio debe seleccionar una medida" effect="puff"
                                                             height="140" disabled="true">
                                                <f:selectItem itemLabel="Und." />
                                                <f:selectItems  value="#{scReplacementBean.measureUnitsList}" var="measure" itemLabel="#{measure.acronym}"/>
                                            </p:selectOneMenu>
                                        </td>
                                        <td width="10%" align="right">
                                            <p:outputLabel  for="tfObservationsDimension" value="Observaciones"/>
                                        </td>
                                        <td  width="40%" align="left"> 
                                            <p:inputTextarea   id="tfObservationsDimension"  value="#{scReplacementBean.replacementSelected.dimension.observations}"
                                                               style="width: 98%;"     disabled="true"/>
                                        </td>
                                    </tr>

                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para stock y dimensiones-->
                        <!--                        inicia pestaña para especificaciones-->
                        <p:tab title="Especificaciones" id="tabSpecifications" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las especificaciones del repuesto y consumible">
                            <p:panel header="Especificaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td align="center" valign="top">
                                            <p:dataTable id="dataTableSpecificationSave"
                                                         var="specifications" 
                                                         value="#{scReplacementBean.getAttachedList(scReplacementBean.replacementSelected.replacementAttacheds, 'SPECIFICATION')}"
                                                         rowKey="#{specifications.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{specifications.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableSpecificationSave" title="Eliminar Especificaciones"
                                                                     process="dataTableSpecificationSave" 
                                                                     actionListener="#{scReplacementBean.deleteAttached(scReplacementBean.replacementSelected.replacementAttacheds, specifications)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{specifications.tittle}">
                                                    <p:outputLabel value="#{specifications.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{specifications.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{specifications.description}">
                                                    <p:outputLabel value="#{specifications.description}" id="outDescription"/>
                                                    <p:tooltip value="#{specifications.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para especificaciones-->
                        <!--                        inicia pestaña para características-->
                        <p:tab title="Características" id="tabFeactures" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las características del repuesto y consumible">
                            <p:panel header="Características" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td  align="center" valign="top">
                                            <p:dataTable id="dataTableFeactureSave"
                                                         var="feactures" 
                                                         value="#{scReplacementBean.getAttachedList(scReplacementBean.replacementSelected.replacementAttacheds, 'FEACTURE')}"
                                                         rowKey="#{feactures.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{feactures.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableFeactureSave" title="Eliminar Características"
                                                                     process="dataTableFeactureSave" 
                                                                     actionListener="#{scReplacementBean.deleteAttached(scReplacementBean.replacementSelected.replacementAttacheds, feactures)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{feactures.tittle}">
                                                    <p:outputLabel value="#{feactures.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{feactures.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{feactures.description}">
                                                    <p:outputLabel value="#{feactures.description}" id="outDescription"/>
                                                    <p:tooltip value="#{feactures.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para características-->
                        <!--                        inicia pestaña para observaciones-->
                        <p:tab title="Observaciones" id="tabObservations" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para las observaciones del repuesto y consumible">
                            <p:panel header="Observaciones" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td align="center" valign="top">
                                            <p:dataTable id="dataTableObservationSave"
                                                         var="observation" 
                                                         value="#{scReplacementBean.getAttachedList(scReplacementBean.replacementSelected.replacementAttacheds, 'OBSERVATION')}"
                                                         rowKey="#{observation.tittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{observation.tittle}">
                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-close" update="dataTableObservationSave" title="Eliminar Observaciones"
                                                                     process="dataTableObservationSave" 
                                                                     actionListener="#{scReplacementBean.deleteAttached(scReplacementBean.replacementSelected.replacementAttacheds, observation)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{observation.tittle}">
                                                    <p:outputLabel value="#{observation.tittle}" id="outTittle"/>
                                                    <p:tooltip value="#{observation.tittle}" for="outTittle"/>
                                                </p:column>
                                                <p:column  headerText="Observación" sortBy="#{observation.description}">
                                                    <p:outputLabel value="#{observation.description}" id="outDescription"/>
                                                    <p:tooltip value="#{observation.description}" for="outDescription"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para observaciones-->
                        <!--                        inicia pestaña para documentos-->
                        <p:tab title="Documentos" id="tabDocuments" titleStyleClass="tabTittleSavePerson" 
                               titletip="Pestaña para los documentos del repuesto y consumible">
                            <p:panel header="Documentos" >
                                <table width="98%" cellspacing="10" >
                                    <tr>
                                        <td width="60%" align="center" valign="top">
                                            <p:dataTable id="dataTableDocumentationSave"
                                                         var="document" 
                                                         value="#{scReplacementBean.replacementSelected.replacementDocuments}"
                                                         rowKey="#{document.documentTittle}"
                                                         paginator="true" rows="10"  
                                                         pageLinks="40" editable="true"
                                                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                                         {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                                         liveResize="true" rowsPerPageTemplate="15,30,50"
                                                         paginatorPosition="top"
                                                         sortBy="#{document.documentTittle}">

                                                <p:column  style="width:32px">
                                                    <p:commandButton icon="ui-icon-arrowthickstop-1-s" update="dataTableDocumentationSave" title="Descargar Documento"
                                                                     process="@this" ajax="false" onstart="start()" oncomplete="stop()"
                                                                     actionListener="#{scReplacementBean.downloadDocument(document)}" >
                                                    </p:commandButton>
                                                </p:column>
                                                <p:column  headerText="Título" sortBy="#{document.documentTittle}">
                                                    <p:outputLabel value="#{document.documentTittle}" id="outTittle"/>
                                                    <p:tooltip value="#{document.documentTittle}" for="outTittle"/>
                                                </p:column>                                                 
                                                <p:column  headerText="Documento" sortBy="#{document.documentName}">
                                                    <p:outputLabel value="#{document.documentName}" id="documentName"/>
                                                    <p:tooltip value="#{document.documentName}" for="documentName"/>
                                                </p:column>
                                                <p:column  headerText="Fecha de Subida" sortBy="#{scReplacementBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}">
                                                    <p:outputLabel value="#{scReplacementBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" id="uploadDate"/>
                                                    <p:tooltip value="#{scReplacementBean.getFormatDateGlobal('dd/MM/yyyy hh:mm:ss', document.creationDate)}" for="uploadDate"/>
                                                </p:column>
                                                <p:column  headerText="Subido por" sortBy="#{document.uploadBy}">
                                                    <p:outputLabel value="#{document.uploadBy}" id="uploadBy"/>
                                                    <p:tooltip value="#{document.uploadBy}" for="uploadBy"/>
                                                </p:column>
                                            </p:dataTable>
                                        </td>
                                    </tr>
                                </table>
                            </p:panel>
                        </p:tab>
                        <!--                        finaliza pestaña para documentos                   -->
                    </p:tabView>
                </h:form>
            </p:dialog>
            <!--################ finaliza el dialogo para visualizar Repuestos y Consumibles ######################33-->

            <!--           dialogo para crear un centro de costos-->
            <p:dialog id="centerCostSave" widgetVar="centerCostSave" draggable="true"  
                      closable="true"  header="Agregar un Centro de Costos" position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >
                <h:form id="formCostCenter">
                    <table width="98%" cellspacing="10" >
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfAreaCostCenter" value="Nombre del Área"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfAreaCostCenter"  value="#{scReplacementBean.costCenterSave.description}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar el área del centro de costos"/>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfcodigoCostCenter" value="Código"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfcodigoCostCenter"  value="#{scReplacementBean.costCenterSave.costCenter}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar el código del centro de costos"/>
                            </td>
                        </tr>
                        <tr>

                            <td  align="center" colspan="2">
                                <p:commandButton value="Guardar" actionListener="#{scReplacementBean.addCostCenter()}"  
                                                 onsuccess="PF('centerCostSave').hide()"
                                                 update="@this,tfAreaCostCenter,tfcodigoCostCenter,:formWizardSave:cbCostCenter,:formWizardUpdate:cbCostCenter"/>
                                <p:spacer width="20"/>

                                <p:commandButton value="Cancelar" actionListener="#{scReplacementBean.cleanFieldsCostCenter()}" 
                                                 oncomplete="PF('centerCostSave').hide()"
                                                 update="@this,tfAreaCostCenter,tfcodigoCostCenter"/>
                            </td>
                        </tr>
                    </table> 
                </h:form>
            </p:dialog>
            <!--         fin  dialogo para crear un centro de costos-->
            <!--           dialogo para crear una medida-->
            <p:dialog id="measureSave" widgetVar="measureSave" draggable="true" 
                      closable="true"  header="Agregar una Medida" position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >
                <h:form id="formMeasure">
                    <table width="98%" cellspacing="10" >
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfAcronym" value="Medida"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfAcronym"  value="#{scReplacementBean.measureUnitSave.acronym}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar la unidad de medida"/>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfTypeMeasure" value="Tipo"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfTypeMeasure"  value="#{scReplacementBean.measureUnitSave.type}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar el tipo de medida"/>
                            </td>
                        </tr>
                        <tr>

                            <td  align="center" colspan="2">
                                <p:commandButton value="Guardar" actionListener="#{scReplacementBean.addMeasure()}"  
                                                 onsuccess="PF('measureSave').hide()"
                                                 update="@this,tfAcronym,tfTypeMeasure,:formWizardSave:cbMeasureHigh,:formWizardSave:cbMeasureWidth,:formWizardSave:cbMeasureLarge,
                                                 :formWizardSave:cbMeasureVolume,:formWizardSave:cbMeasureThickness,:formWizardSave:cbMeasureRadio,:formWizardSave:cbMeasureWeight
                                                 ,:formWizardUpdate:cbMeasureHigh,:formWizardUpdate:cbMeasureWidth,:formWizardUpdate:cbMeasureLarge,
                                                 :formWizardUpdate:cbMeasureVolume,:formWizardUpdate:cbMeasureThickness,:formWizardUpdate:cbMeasureRadio,
                                                 :formWizardUpdate:cbMeasureWeight"/>
                                <p:spacer width="20"/>

                                <p:commandButton value="Cancelar" actionListener="#{scReplacementBean.cleanFieldsMeasure()}" 
                                                 oncomplete="PF('measureSave').hide()"
                                                 update="@this,tfAcronym,tfTypeMeasure"/>
                            </td>
                        </tr>
                    </table>
                </h:form>
            </p:dialog>
            <!--         fin  dialogo para crear una medida-->

            
            
            <!--           dialogo para crear localizaciones-->
            <p:dialog id="replacementLocationSave" widgetVar="replacementLocationSave" draggable="true" 
                      closable="true"  header="Agregar una Localización del Repuesto" position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >
                <h:form id="formReplacementLocation">
                    <table width="98%" cellspacing="10" >
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfLocation" value="Localización"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputText    id="tfLocation"  value="#{scReplacementBean.replacementLocationSave.location}"
                                                required="true" requiredMessage="Campo obligatorio debe ingresar la localización del repuesto y consumible"/>
                            </td>
                        </tr>
                        <tr>
                            <td width="20%" align="right">
                                <p:outputLabel  for="tfDescriptionLocation" value="Descripción"/>
                            </td>
                            <td width="80%" align="left">
                                <p:inputTextarea    id="tfDescriptionLocation"  value="#{scReplacementBean.replacementLocationSave.description}"
                                                    />
                            </td>
                        </tr>
                        <tr>



                            <td  align="center" colspan="2">
                                <p:commandButton value="Guardar" actionListener="#{scReplacementBean.addReplacementLocations()}"  
                                                 onsuccess="PF('replacementLocationSave').hide()"
                                                 update="@this,tfDescriptionLocation,tfLocation,:formWizardSave:cbLocation,:formWizardUpdate:cbLocation"/>
                                <p:spacer width="20"/>

                                <p:commandButton value="Cancelar" actionListener="#{scReplacementBean.cleanFieldsLocationReplacement()}" 
                                                 oncomplete="PF('replacementLocationSave').hide()"
                                                 update="tfDescriptionLocation,tfLocation,@this"/>
                            </td>
                        </tr>
                    </table>
                </h:form>
            </p:dialog>
            <!--         fin  dialogo para crear localizaciones del repuesto y consumible-->
            <!--            Dialogo para subir imagenes width="10%" align="right" -->
            <p:dialog id="pictureSave" widgetVar="pictureSave" draggable="true" 
                      closable="true"  header="Cargar Imagen..." position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >

                <h:form enctype="multipart/form-data" prependId="false">
                    <p:panelGrid columns="2" style="border: 0px solid; text-align: center;">
                        <p:fileUpload label="Imagen del Repuesto" value="#{scReplacementBean.pictureFile}" mode="simple"
                                      >       >        
                        </p:fileUpload>

                        <p:commandButton id="btnLoadDocument" value="Cargar" icon="ui-icon-circle-arrow-s"
                                         actionListener="#{scReplacementBean.handleFileUpload(1)}" ajax="false" ignoreAutoUpdate="true"/>
                    </p:panelGrid>
                </h:form>
            </p:dialog>
            <!--            finaliza el dialogo para subir imagenes-->
            <!--            Dialogo para actualizar imagenes width="10%" align="right" -->
            <p:dialog id="pictureUpdate" widgetVar="pictureUpdate" draggable="true" 
                      closable="true"  header="Cargar Imagen..." position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >

                <h:form enctype="multipart/form-data" prependId="false">
                    <p:panelGrid columns="2" style="border: 0px solid; text-align: center;">
                        <p:fileUpload label="Imagen del Repuesto" value="#{scReplacementBean.pictureFile}" mode="simple"
                                      >       >        
                        </p:fileUpload>

                        <p:commandButton id="btnLoadDocumentUpdate" value="Cargar" icon="ui-icon-circle-arrow-s"
                                         actionListener="#{scReplacementBean.handleFileUpload(2)}" ajax="false" ignoreAutoUpdate="true" />
                    </p:panelGrid>
                </h:form>
            </p:dialog>
            <!--            finaliza el dialogo para actualizar imagenes-->

            <!--            Dialogo para subir documentos width="10%" align="right" -->
            <p:dialog id="documentSave" widgetVar="documentSave" draggable="true" 
                      closable="true"  header="Cargar Documento..." position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >

                <h:form enctype="multipart/form-data" prependId="false">
                    <p:panelGrid columns="2" style="border: 0px solid; text-align: center;">
                        <p:outputLabel for="tfDocument" value="Título del Documento"/>

                        <p:inputText value="#{scReplacementBean.replaceDocumentsSave.documentTittle}" id="tfDocument"/> 

                        <p:fileUpload label="Documento de un Repuesto" value="#{scReplacementBean.fileSave}" mode="simple"
                                      update=":formWizardSave:dataTableDocumentationSave">  
                        </p:fileUpload>

                        <p:commandButton id="btnLoadFile" value="Cargar" icon="ui-icon-circle-arrow-s" 
                                         actionListener="#{scReplacementBean.handleDocumentUpload(1)}" ajax="false" 
                                         update=":formWizardSave:dataTableDocumentationSave"/>
                    </p:panelGrid>
                </h:form>
            </p:dialog>
            <!--            finaliza el dialogo para subir documentos-->

            <!--            Dialogo para subir actualizar -->
            <p:dialog id="documentUpdate" widgetVar="documentUpdate" draggable="true" 
                      closable="true"  header="Actualizar Documento..." position="center top" 
                      hideEffect="explode" modal="true" showEffect="explode" 
                      >

                <h:form enctype="multipart/form-data" prependId="false">
                    <p:panelGrid columns="2" style="border: 0px solid; text-align: center;">
                        <p:outputLabel for="tfDocumentUpdate" value="Título del Documento"/>

                        <p:inputText value="#{scReplacementBean.replaceDocumentsSave.documentTittle}" id="tfDocumentUpdate"/> 

                        <p:fileUpload label="Documento de un Repuesto" value="#{scReplacementBean.fileSave}" mode="simple"
                                      update=":formWizardUpdate:dataTableDocumentationSave">  
                        </p:fileUpload>

                        <p:commandButton id="btnLoadFileUpdate" value="Cargar" icon="ui-icon-circle-arrow-s" 
                                         actionListener="#{scReplacementBean.handleDocumentUpload(2)}" ajax="false" 
                                         update=":formWizardUpdate:dataTableDocumentationSave"/>
                    </p:panelGrid>
                </h:form>
            </p:dialog>
            <!--            finaliza el dialogo para actualizar documentos-->
            
            
<!--            ######################################################################-->
            
        
            <h:form id="formReplacement">
                <p:remoteCommand name="replacementInit" update=":formReplacement:scDataTableReplacements" />
                <p:dataTable id="scDataTableReplacements" draggableColumns="true" emptyMessage="No existe información para visualizar" 
                             value="#{scReplacementBean.replacementList}" var="replacement"
                             paginator="true" rows="10"  
                             pageLinks="40"
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                             {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             rowKey="#{replacement.idReplacement}"
                             resizableColumns="true" 
                             liveResize="true" rowsPerPageTemplate="10,20,30" 
                             selectionMode="single" paginatorPosition="top" selection="#{scReplacementBean.replacementSelected}"
                             sortBy="#{replacement.idReplacement}"
                             >
                    <f:facet name="header">
                        <p:commandButton icon="ui-icon-plus" id="btnAdd" style="float: right;"  
                                         oncomplete="PF('dialogReplacementSave').show()">
                            <p:tooltip for="btnAdd" value="Agregar un Repuesto"/>
                        </p:commandButton>
                    </f:facet>
                    
                    <p:column filterMatchMode="contains"  filterBy="#{replacement.name}" headerText="Repuesto" sortBy="#{replacement.name}" id="columnReplacementName">    
                        <center>
                            <p:outputLabel value="#{replacement.name}" id="lblIntputName"/>
                            <p:tooltip for="lblIntputName" value="#{replacement.name}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{replacement.typeReplacement}" headerText="Tipo" sortBy="#{replacement.typeReplacement}" id="columnTypeReplacement">    
                        <center>
                            <p:outputLabel value="#{replacement.typeReplacement}" id="lblTypeReplacement"/>
                            <p:tooltip for="columnTypeReplacement" value="#{replacement.typeReplacement}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{replacement.mark}" id="columnMark" headerText="Marca" sortBy="#{replacement.mark}">    
                        <center>
                            <p:outputLabel value="#{replacement.mark}" id="lblMark"/>
                            <p:tooltip for="lblMark" value="#{replacement.mark}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{replacement.serie}" id="columnSerie" headerText="Serie" sortBy="#{replacement.serie}">    
                        <center>
                            <p:outputLabel value="#{replacement.serie}" id="lblSerie"/>
                            <p:tooltip for="lblSerie" value="#{replacement.serie}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{replacement.stock.idStore.name}" id="columnStore" headerText="Almacen" sortBy="#{replacement.stock.idStore.name}">    
                        <center>
                            <p:outputLabel value="#{replacement.stock.idStore.name}" id="lblStore"/>
                            <p:tooltip for="lblStore" value="#{replacement.stock.idStore.name}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{replacement.inputLocation.location}" id="columnLocation" headerText="Localización" sortBy="#{replacement.inputLocation.location}">    
                        <center>
                            <p:outputLabel value="#{replacement.inputLocation.location}" id="lblLocation"/>
                            <p:tooltip for="lblLocation" value="#{replacement.inputLocation.location}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{replacement.stock.currentStock}" id="columnAmount" headerText="Existencias" sortBy="#{replacement.stock.currentStock}">    
                        <center>
                            <p:outputLabel value="#{replacement.stock.currentStock}" id="lblamount"/>
                            <p:tooltip for="lblamount" value="#{replacement.stock.currentStock}"/>
                        </center>
                    </p:column>

                    <p:column filterMatchMode="contains"  filterBy="#{replacement.usefulLife} #{replacement.time.acronym}" id="columPackingUnit" headerText="Vida Útil" sortBy="#{replacement.usefulLife} #{replacement.time.acronym}">    
                        <center>
                            <p:outputLabel value="#{replacement.usefulLife} #{replacement.time.acronym}" id="lblPackingUnit"/>
                            <p:tooltip for="lblPackingUnit" value="#{replacement.usefulLife} #{replacement.time.acronym}"/>
                        </center>
                    </p:column>

                    <p:column filterMatchMode="contains"  filterBy="#{replacement.value} #{replacement.money.acronym}" id="columnValue" headerText="Valor" sortBy="#{replacement.value}">    
                        <center>
                            <p:outputLabel value="#{replacement.value} #{replacement.money.acronym}" id="lblValue"/>
                            <p:tooltip for="lblValue" value="#{replacement.value} #{replacement.money.acronym}"/>
                        </center>
                    </p:column>
                    <p:column headerText="Admin" width="100">
                        <center>
                            <p:commandButton icon="ui-icon-search" id="btnSearch" update=":formWizardView:"
                            actionListener="#{scReplacementBean.selectedForView(replacement)}"
                            oncomplete="PF('dialogReplacementView').show()">
                                <p:tooltip for="btnSearch" value="Visualizar un Repuesto o Consumible"/>
                            </p:commandButton>
                            <p:spacer width="3"/>
                            <p:commandButton icon="ui-icon-pencil" id="btnEdit" actionListener="#{scReplacementBean.selectedForUpdate(replacement)}"
                                             oncomplete="PF('dialogReplacementUpdate').show()" update=":formWizardUpdate:" 
                                             >
                                <p:tooltip for="btnEdit" value="Editar un Repuesto o Consumible"/>
                            </p:commandButton>
                            <p:spacer width="3"/>
                            <p:commandButton icon="ui-icon-close" id="btnDelete" oncomplete="PF('dialogReplacementDelete').show()"
                                             actionListener="#{scReplacementBean.selectedForDelete(replacement)}" update=":formWizardDelete">
                                <p:tooltip for="btnDelete" value="Eliminar un Repuesto o Consumible"/>
                            </p:commandButton>
                        </center>
                    </p:column>
                </p:dataTable>
            </h:form>
        </div>
    </h:body>
</html>

